package com.myzl.web.controller.visualization;

import com.myzl.coal.service.IStatisticsService;
import com.myzl.common.core.domain.AjaxResult;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 皮带秤数据统计
 * @author cew
 * @date 2023年7月10日13:40:44
 */
@RestController
@Slf4j
@Data
@RequestMapping("/visualization/statistics/")
public class StatisticsController {

    private final IStatisticsService statisticsService;

    /**
     * 查询对比分析统计数据
     * @param date 日期
     * @return 结果
     */
    @GetMapping("/contrast/{date}")
    public AjaxResult contrast(@PathVariable("date") String date)
    {
        return statisticsService.daily(date);
    }

    /**
     * 查询对比分析统计数据
     */
    @GetMapping("/contrast/{date}/{deviceId}")
    public AjaxResult contrast(@PathVariable("date") String date,@PathVariable("deviceId") Integer deviceId)
    {
        return statisticsService.daily(date,deviceId);
    }
}
